/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.ban.jr.swb.rest.mq.main;

import cn.ac.iie.di.ban.jr.swb.rest.mq.global.GlobalParas;
import static cn.ac.iie.di.ban.jr.swb.rest.mq.global.GlobalParas.TVHOT_COLUMNS_TYPE_LIST;
import cn.ac.iie.di.ban.jr.swb.rest.mq.handlers.TimeTask;
import java.util.Timer;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.log4j.Logger;

/**
 *
 * @author zwlin
 */
public class SwbMain {

    public static Logger LOG = Logger.getLogger(SwbMain.class);

    public static void main(String[] args) {
        try {
            GlobalParas.getIstance(GlobalParas.DEFAULT_CONFIGURATION);
            LOG.info("Init Configuration" + GlobalParas.TVHOT_COLUMNS_TYPE_LIST.size());
            startTimeTask();
        } catch (ConfigurationException e) {
            LOG.error(e.getMessage(), e);
        }
    }

    public static void startTimeTask() {
        TimeTask timeTask = new TimeTask();
        Timer timer = new Timer();
        timer.schedule(timeTask, 1000, 1000 * 60 * 30);
    }
}
